package com.rc.saas.tenant.controller.acct;

import cn.licoy.encryptbody.annotation.encrypt.EncryptBody;
import cn.licoy.encryptbody.enums.EncryptBodyMethod;
import com.rc.saas.tenant.common.vo.TResponse;
import com.rc.saas.tenant.crypto.annotation.RequestBodyDecrypt;
import com.rc.saas.tenant.crypto.annotation.ResponseBodyEncrypt;
import com.rc.saas.tenant.vo.order.StartPrintReq;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.*;


/**
 * @author frog
 * @date 2021/1/12
 */
@RestController
@RequestMapping("/test")
public class TestController {

    private static Logger logger = LogManager.getLogger(TestController.class);

    /**
     * 跳转分销商列表(结算中心)
     *
     * @return
     */
    @RequestMapping(value = "/index", method = RequestMethod.GET)
    public String index() {
        return "/templates/acct/acctTenantOperator";
    }

    @RequestBodyDecrypt   //请求数据解密
    @ResponseBodyEncrypt  //响应数据加密
    @RequestMapping(value = "/start", method = RequestMethod.GET)
    @ResponseBody
    public TResponse id(@RequestBody StartPrintReq startPrintReq) {
        logger.info(startPrintReq.toString());
        //return "hello world";
        return TResponse.SUCCESS(startPrintReq.getOrderNum());
    }

    @GetMapping(value = "/id")
    @ResponseBody
    @RequestBodyDecrypt   //请求数据解密
    @ResponseBodyEncrypt  //响应数据加密
    public String test() {
        return "hello world";
    }
}
